package com.guaoran.micro.services.spring.boot.actuator.controller;

import com.guaoran.micro.services.spring.boot.actuator.domain.Test;
import com.guaoran.micro.services.spring.boot.actuator.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author gucheng
 * @Description test
 * 2019-07-11 9:53
 */
@RestController
public class TestController {
    @Autowired
    private TestService testService;

    @PostMapping("/save")
    public String saveTest(@RequestBody Test test){
        testService.save(test);
        return "SUCCESS";
    }

    @GetMapping("/get/{id}")
    public Test getTest(@PathVariable("id") Long id){
        Test test = testService.getTest(id);
        return test;
    }
}
